<?php

namespace App\Http\Requests\Mini\Estate;

use Illuminate\Foundation\Http\FormRequest;

class ElectricRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'id'   => 'required|integer',
            'type' => 'required|digits:1',
        ];
    }

    /**
     * Notes: 提示信息
     * User: lstink
     * Date: 2021/3/17
     * Time: 2:39 下午
     * @return string[]
     */
    public function messages(): array
    {
        return [
            'id.required'   => 'id不能为空',
            'id.integer'    => 'id必须是数字',
            'type.required' => 'type不能为空',
            'type.size'     => 'type最大长度为1',
        ];
    }
}
